package reflect;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

/**
 * 使用指定构造器实例化对象
 */
public class ReflectDemo3 {
    public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
        Class cls = Class.forName("reflect.Person");
        cls.getConstructor();

        //Constructor c = cls.getConstructor(String.class,int.class);
        //Object o = c.newInstance("沧桑",55);
        //System.out.println(o);
    }
}
